.h-func-clearfix() {
  &::after {
    content: "";
    display: block;
    clear: both;
  }
}

.h-func-link() {
  color: @link-color;
  cursor: pointer;
  text-decoration: none;
  outline: none;
  transition: color @transition-time ease;
  &:hover {
    color: darken(@link-color, 10%) !important;
  }
  &:active {
    color: darken(@link-color, 20%) !important;
  }
  &:active, &:hover{
    outline: 0;
    text-decoration: none;
  }
  &[disabled] {
    color: @disabled-color !important;
    cursor: default;
  }
}

.h-func-text-ellipsis() {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h-func-text-hover() {
  cursor: pointer;
  transition: color @transition-time ease;

  &:hover {
    color: @link-color !important;
  }
  
  &:active {
    color: darken(@link-color, 15%) !important;
  }
  
  &.@{pop-ref-prefix} &{
    color: darken(@link-color, 10%) !important;
  }
  &[disabled] {
    color: @disabled-color !important;
    cursor: default;
  }
}

.h-func-dark-text-hover() {
  cursor: pointer;
  transition: color @transition-time ease;

  color: @dark4-color;

  &:hover {
    color: @dark2-color !important;
  }

  &:active {
    color: darken(@dark2-color, 10%) !important;
  }

  &[disabled] {
    color: @disabled-color !important;
    cursor: default;
  }
}

.h-func-fullscreen() {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  top: 0;
}

.h-func-li-hover() {
  cursor: pointer;
  &:hover {
    background-color: @hover-background-color;
  }

  &.disabled{
    cursor: default;
    &:hover {
      background-color: transparent;
    }
  }
}

.h-func-input-right-icon() {
  position: absolute;
  top: 50%;
  right: 8px;
  font-size: 12px;
  z-index: 3;
  .h-func-text-hover();
  color: @dark2-color;
  margin-top: -6px;
}

.h-func-tag-span() {
  margin-bottom: 2px;
  display: inline-block;
  border-radius: max(@border-radius - 2px, 0);
  transition: all linear @transition-time;
  margin-right: 5px;
  border: 1px solid @tag-border-color;
  background-color: @tag-background-color;
  font-size: @font-size-input-tag;
  padding: 0px 8px;
  >span {
    line-height: @input-height - 8px;
  }
  >.h-icon-close-min{
    font-size: @font-size + 2px;
    color: @dark2-color;
    display: inline-block;
    width: 14px;
    margin-left: 2px;
    cursor: pointer;
    vertical-align: -2px;
    .h-func-text-hover();
  }
  >.h-icon-close{
    line-height: @input-height - 8px;
    display: inline-block;
    font-size: @font-size-mini - 1px;
    color: @dark2-color;
    margin-left: 5px;
    .h-func-text-hover();
  }
}


.h-func-border-input() {
  cursor: default;
  background-color: @white-color;
  border-radius: @border-radius;
  border: @border;
  vertical-align: top;
  transition: all linear @transition-time;
  padding: 2px 2px 0px 2px;
  font-size: @font-size-mini;
  position: relative;
  box-sizing: border-box;
  &:hover {
    border-color: lighten(@primary-color, 10%);
  }
  &.@{pop-ref-prefix}, &.focusing {
    border-color: @primary-color;
    box-shadow: @box-shadow-input;
  }

  .@{prefix}form-item-valid-error &{
    border-color: @red-color;
    &:focus, &.focusing{
      box-shadow: @box-shadow-error-input;
    }
  }
}


.h-func-border-input-inside-input() {
  flex: 1;
  min-width: 80px;
  width: auto;
  max-width: 100%;
  border-color: transparent !important;
  line-height: @font-size-input;
  font-size: @font-size-input;
  height: @input-height - 6px;
  margin-bottom: 2px;
  padding-left: 5px;
  &:focus{
    box-shadow: none !important;
  }
}

.h-func-plugin-input(@css-prefix) {
  .@{css-prefix}{
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;
    &-placeholder {
      color: #787878;
    }
    &-value-single,
    &-placeholder {
      line-height: @input-height - 6px;
      height: @input-height - 6px;
      padding-left: 5px;
      .h-func-text-ellipsis();
    }
    &-show {
      padding-right: 25px !important;
      .h-func-rotate-icon-down();
      position: relative;
      cursor: default;
      line-height: @line-height;
    }
    &-multiple-tags {
      display: flex;
      flex-wrap: wrap;
      >span {
        .h-func-tag-span();
      }
    }
    &-input-border {
      .@{css-prefix}{
        &-show {
          min-height: @input-height;
          .h-func-border-input();
          .@{prefix}form-item-valid-error & {
            border-color: @red-color;
            &.@{pop-ref-prefix} {
              box-shadow: @box-shadow-error-input;
            }
          }
        }
        &-value-single,
        &-placeholder {
          margin-bottom: 2px;
        }
      }
    }
    &-no-autosize {
      display: block;
    }
    &-disabled &-show {
      .h-func-border-input-disabled();
    }
  }
}

.h-func-border-input-disabled() {
  background-color: @disabled-background-color;
  color: @disabled-color !important;
  border-color: @disabled-border-color;
  &:hover {
    border-color: @disabled-border-color;
    color: @disabled-color !important;
  }
  .h-icon-down {
    color: @disabled-color !important;
  }
}

.middle() {
  position: absolute;
  top: 50%;
  transform: translate(0%, -50%);
}

.middle-center() {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


.h-func-rotate-icon-down(@hasColor: true){
  >.h-icon-down {
    color: @dark2-color;
    position: absolute;
    right: 8px;
    top: 50%;
    height: 10px;
    font-size: 12px;
    line-height: 12px;
    transform: translate(0, -50%) scale(0.8);
    transition: transform @transition-time;
  }
  &:hover when (@hasColor){
    >.h-icon-down {
      color: @primary-color;
    }
  }
  &.@{pop-ref-prefix}>.h-icon-down {
    transform: rotate(-180deg) translate(0, 50%) scale(0.8);
    & when (@hasColor){
      color: @primary-color;
    }
  }
}

.h-func-rotate-middle-icon-down(@hasColor: true) {
  >.h-icon-down {
    color: @dark2-color;
    position: absolute;
    left: 50%;
    top: 50%;
    height: 10px;
    font-size: 12px;
    line-height: 12px;
    transform: translate(-50%, -50%) scale(0.8);
    transition: transform @transition-time;
  }
  &:hover when (@hasColor){
    >.h-icon-down {
      color: @primary-color;
    }
  }
  &.@{pop-ref-prefix}>.h-icon-down {
    transform: rotate(-180deg) translate(50%, 50%) scale(0.8);
    & when (@hasColor){
      color: @primary-color;
    }
  }
}

.h-func-tag-color(@color){
  color: darken(@color, 10%);
  background: lighten(average(@color, #FFF), 10%);
  border-color: lighten(average(@color, #FFF), 10%);
}

.h-func-tag-bg-color(@color){
  color: @white-color;
  background: lighten(@color, 3%);
  border-color: lighten(@color, 3%);
}


@input-base-padding: @input-height / 4;
.h-func-input() {
  min-width: 1px;
  position: relative;
  background-color: @white-color;
  border-radius: @border-radius;
  border: @border;
  display: inline-block;
  padding: 4px @input-base-padding;
  line-height: 1.5;
  font-size: @font-size-input;
  transition: all linear @transition-time;
  box-sizing: border-box;
  -webkit-appearance: none;
  font-family: inherit;
  vertical-align: top;
  outline: none;
  &:hover {
    border-color: lighten(@primary-color, 10%);
  }
  &:focus {
    border-color: @primary-color;
    box-shadow: @box-shadow-input;
  }
  &[disabled],
  &[readonly] {
    border-color: @disabled-border-color;
    &:focus {
      box-shadow: none;
    }
  }
  &[readonly]{
    color: @dark1-color;
    box-shadow: none;
    cursor: default;
  }
  &[disabled] {
    color: @disabled-color;
    background-color: @disabled-background-color;
    pointer-events: painted;
    cursor: @disabled-cursor;
  }
  .@{prefix}form-item-valid-error &{
    border-color: @red-color;
    &:focus{
      box-shadow: @box-shadow-error-input;
    }
  }
}

.h-func-list-style {
  list-style: none;
  margin: 0;
  padding: 0;
  outline: none;
  box-sizing: border-box;
}